Foodsystem
Introduction
Are you tired of lackluster food systems in your FiveM server? Say goodbye to bland and boring meal mechanics and say hello to the next level of immersive gameplay! Our unique Food System script revolutionizes the dining experience in your virtual world, offering a plethora of features that will keep your players engaged and craving for more.
Get it now!
Installation
- Put
ensure sqz_foodsystem
to your server.cfg (or any start cfg file) and put the resource namedsqz_foodsystem
-maybe you will have to rename it- into yourresources
folder. - Download dependencies: ox_lib, ox_target
- Insert new animations to your emotes menu:
- bk_emotes
- dpemotes
- scully_emotemenu
- Into bk_emotes/Client/AnimationList.lua , DP.PropEmotes table insert:
["carryplates"] = {"anim@heists@box_carry@", "idle", "Carry Plates", AnimationOptions =
{
Prop = "prop_cs_plate_01",
PropBone = 60309,
PropPlacement = {0.09, -0.04, 0.11, -100.0, 40.0, 40.0},
SecondProp = 'prop_cs_plate_01',
SecondPropBone = 57005,
SecondPropPlacement = {0.18, -0.01, -0.11, -110.0, -10.0, 30.0},
EmoteLoop = true,
EmoteMoving = true,
}},
["carrydrinks"] = {"anim@heists@humane_labs@finale@keycards", "ped_a_enter_loop", "Carry Drinks", AnimationOptions =
{
Prop = 'v_ret_247_popcan2',
PropBone = 18905,
PropPlacement = {0.12, 0.12, -0.02, -104.0, 27.0, -19.0},
EmoteMoving = true,
EmoteLoop = true
}},
- Into dpemotes/Client/AnimationList.lua , DP.PropEmotes table insert:
["carryplates"] = {"anim@heists@box_carry@", "idle", "Carry Plates", AnimationOptions =
{
Prop = "prop_cs_plate_01",
PropBone = 60309,
PropPlacement = {0.09, -0.04, 0.11, -100.0, 40.0, 40.0},
SecondProp = 'prop_cs_plate_01',
SecondPropBone = 57005,
SecondPropPlacement = {0.18, -0.01, -0.11, -110.0, -10.0, 30.0},
EmoteLoop = true,
EmoteMoving = true,
}},
["carrydrinks"] = {"anim@heists@humane_labs@finale@keycards", "ped_a_enter_loop", "Carry Drinks", AnimationOptions =
{
Prop = 'v_ret_247_popcan2',
PropBone = 18905,
PropPlacement = {0.12, 0.12, -0.02, -104.0, 27.0, -19.0},
EmoteMoving = true,
EmoteLoop = true
}},
- Into scully_emotemenu/animations/prop_emotes.lua table insert:
{
Label = 'Carry Plates',
Command = 'carryplates',
Animation = 'idle',
Dictionary = 'anim@heists@box_carry@',
Options = {
Flags = {
Loop = true,
Move = true,
},
Props = {
{
Bone = 60309,
Name = 'prop_cs_plate_01',
Placement = {
vec3(0.09, -0.04, 0.11),
vec3(-100.0, 40.0, 40.0)
},
},
{
Bone = 57005,
Name = 'prop_cs_plate_01',
Placement = {
vec3(0.18, -0.01, -0.11),
vec3(-110.0, -10.0, 30.0)
},
},
},
},
},
{
Label = 'Carry Drinks',
Command = 'carrydrinks',
Animation = 'ped_a_enter_loop',
Dictionary = 'anim@heists@humane_labs@finale@keycards',
Options = {
Flags = {
Loop = true,
Move = true,
},
Props = {
{
Bone = 18905,
Name = 'v_ret_247_popcan2',
Placement = {
vec3(0.12, 0.12, -0.02),
vec3(-104.0, 27.0, -19.0)
},
},
},
},
},
- Remove esx_basicneeds script from your server (now food part is handled by this script) or remove at least from client/main.lua this part:
AddEventHandler('esx_status:loaded', function(status)
TriggerEvent('esx_status:registerStatus', 'hunger', 1000000, '#CFAD0F', function(status)
return Config.Visible
end, function(status)
status.remove(100)
end)
TriggerEvent('esx_status:registerStatus', 'thirst', 1000000, '#0C98F1', function(status)
return Config.Visible
end, function(status)
status.remove(75)
end)
end)
AddEventHandler('esx_status:onTick', function(data)
local playerPed = PlayerPedId()
local prevHealth = GetEntityHealth(playerPed)
local health = prevHealth
for k, v in pairs(data) do
if v.name == 'hunger' and v.percent == 0 then
if prevHealth <= 150 then
health = health - 5
else
health = health - 1
end
elseif v.name == 'thirst' and v.percent == 0 then
if prevHealth <= 150 then
health = health - 5
else
health = health - 1
end
end
end
if health ~= prevHealth then SetEntityHealth(playerPed, health) end
end)